<!DOCTYPE html>
<html>
    <head>
        <meta charest="UTF-8">
        <title>判断是否是闰年</title>
    </head>
    <body>
    <script>
        function feb(){
            var year=prompt('请输入年份：');
            if(leapYear(year)){
                alert('当前年份是闰年,2月份有29天');
            }else{
                alert('当前年份是平年,2月份有28天');
            }
        }
        feb();
        function leapYear(year1){
            var flag=false;
            if(year1 % 4 == 0 && year1 % 100 != 0 || year1 % 400 == 0){
                flag=true;
            }
            return flag;
        }
    </script>
</body>
</html>